package com.swak.reactivex.p2p;

import com.swak.exception.RemotingException;
import com.swak.reactivex.p2p.exchange.ExchangeGroup;
import com.swak.reactivex.p2p.exchange.ExchangePeer;
import com.swak.reactivex.transport.ExchangeHandler;
import com.swak.reactivex.transport.resources.LoopResources;
import com.swak.registry.URL;

/**
 * Exchangers.
 * 
 * @see use @com.swak.reactivex.cluster
 * 
 * @author 618lf
 */
@Deprecated
public class Exchangers {

	public static ExchangePeer join(String group, String peer, LoopResources resources, ExchangeHandler handler)
			throws RemotingException {
		return Exchangers.join(URL.valueOf(group), URL.valueOf(peer), resources, handler);
	}

	public static ExchangePeer join(URL group, URL peer, LoopResources resources, ExchangeHandler handler)
			throws RemotingException {
		return new ExchangeGroup(group, resources).join(peer, handler);
	}
}